<?php
namespace app\common\model;

use think\Db;

class SiteClassModel extends BaseModel
{
    protected $name = 'site_class'; //定义用户表
    //开启自动写入时间戳
    protected $autoWriteTimestamp = false;
    // 定义自动完成的属性
    protected $auto = []; //新增修改
    protected $insert = []; //插入
    protected $update = []; //修改

    /*读取器*/
    /*修改器*/

    /**
     * 更新缓存
     * @return bool
     */
    public function updateCache()
    {
        $list = Db::table('site_class')->order('site_class_sort')->column('*','site_class_id'); //避免走模型读取器
        cache('site_class',$list);
        return true;
    }
}